﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sales
{
    class Program
    {
        static void Main(string[] args)
        {
            SalesOrder salesOrder = new SalesOrder();

            try
            {
                salesOrder.AddOrderLine();
                salesOrder.AddOrderLine();
                salesOrder.Register();
                salesOrder.AddOrderLine();
                salesOrder.AddOrderLine();
                salesOrder.Grant();
                salesOrder.AddOrderLine();
                salesOrder.AddOrderLine();
                salesOrder.Ship();
                salesOrder.Invoice();
            }
            catch (ChangeStateException ex)
            {
                Console.WriteLine("Failed because: ");
                Console.WriteLine(ex.Message);
            }

        }
    }
}
